//! @Author: DengLibin 
//! @Date:  2022-04-19 17:18:19
//! @Description:
use actix_web::{
    get,
    web::{self},
    HttpRequest, Responder,
};

/// @Author: DengLibin 
/// @Date:  2022-04-19 17:37:33
/// @Description:
#[get("/user/{id}/{name}")]
pub async fn get_user(path: web::Path<(u32, String)>) -> impl Responder {
    let (id, name) = path.into_inner();
    format!("Hello {}! id:{}", name, id)
}

/// @Author: DengLibin 
/// @Date:  2022-04-19 17:37:38
/// @Description:
#[get("/user/userParam")]
pub async fn get_user_param(req: HttpRequest) -> impl Responder {
    println!("{:?}", req);
    let q = req.query_string();
    format!("{}", q)
}
